<?php use_helper('Form') ?>
<?php include_stylesheets_for_form($form) ?>
<?php include_javascripts_for_form($form) ?>
<?php use_javascript('jquery-1.3.2.min.js') ?> 
<?php use_javascript('valida.form.js') ?> 

<script type="text/javascript">

</script>

<form id="form-signup" action="<?php echo url_for('acao/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?cd_acao='.$form->getObject()->getCdAcao() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<?php if (!$form->getObject()->isNew()): ?>
<input type="hidden" name="sf_method" value="put" />
<?php endif; ?>
  <table>
    <tfoot>
      <tr>
        <td colspan="2">
          <input type="button" value="Salvar" class="btn" id="btn_salvar" />
          <?php if ((!$form->getObject()->isNew()) && ($sf_user->getAttribute('gerente',null,'usr'))) : ?>
            &nbsp;<?php echo link_to('Excluir', 'acao/delete?cd_acao='.$form->getObject()->getCdAcao(), array('method' => 'delete', 'confirm' => 'Confirma exclusão?', 'class' => 'link_btn')) ?>
          <?php endif; ?>
        </td>
      </tr>
    </tfoot>
    <tbody>
      <?php echo $form ?>
      <tr>
        <th>Proposição</th>
		<?php $options = array();
		  foreach ($proposicao_list as $proposicao) {
		    $options[$proposicao->getCdProposicao()] = $proposicao->getName();
		  }
		  $this->options = $options;
		?>
        <td><?php echo select_tag('acao[cd_proposicao]', $options) ?></td>
	  </tr>
    </tbody>
  </table>
</form>


<?php if ( !$sf_user->getAttribute('gerente',null,'usr') && (@$_SERVER['PATH_INFO'] != '/acao/new') ) : ?>
  <script type="text/javascript" language="JavaScript">
	dia = document.getElementById("acao_dt_limite_conclusao_day");
	mes = document.getElementById("acao_dt_limite_conclusao_month");
	ano = document.getElementById("acao_dt_limite_conclusao_year");
	dia.disabled = 1;
	mes.disabled = 1;
	ano.disabled = 1;
  </script>
<?php endif; ?>

<br> 
